function replaceTextOnPage() {
    // 递归遍历整个document
    (function scanSubTree(node) {
        if (node.childNodes.length) {
            for (var i = 0; i < node.childNodes.length; i++) {
                // 如果其前一个兄弟节点为 eventTime \ produceTime  \ processTime ,则将当前值转成时间字符串
                scanSubTree(node.childNodes[i]);
            }

        } else if (node.nodeType == Node.TEXT_NODE) {
            result.push(node);
        }

    })(document);

    // node.nodeValue = node.nodeValue.toLowerCase().replace(new RegExp(quote(x), 'g'), obj[x]);
    function quote(str) {
        return (str + '').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
    }
}

chrome.extension.onMessage.addListener(
    function (request, sender, sendMessage) {
        replaceTextOnPage();

        sendMessage('OK');
    });